<?
session_start();

require_once('config.php');
require_once('class/cls_product.php');

$product			= new cls_product();

//if (isset($_REQUEST['coordinator_id']))

//{

//$coordinator_id = $_REQUEST['coordinator_id'];
//echo  $coordinator_id;
//echo $_SESSION['id'];


//}

if (isset($_REQUEST['logout']))

{
	session_destroy();
	unset($_SESSION['username']);
	unset($_SESSION['id']);
	header("Location: index.php");
	exit();
}//LogOut

 

if (isset($_POST['Insert']))

{

	
			$recid	= $product->insert_new_product($_POST);
			
			/* Uploading Image Files */
			$file 	= $_FILES['myfile'];
			if ($file['name'] != "")	{
				$path = "um-img/" . $recid . ".jpg";   // make like um-img/1.jpg
				
				if (!copy($file['tmp_name'], $path)) {
					echo "failed to copy your file...\n";
				}
				else {
					echo "Your file has been successfully uploaded!";
				}
			}
		
					
}

?>
<html>
<head>
<title></title>
<link href="style.css" type="text/css" rel="stylesheet">

<link href="um_sty.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#F7F9F0">
<form action="<?= $_SERVER['PHP_SELF'] ?>" method="post"  enctype="multipart/form-data">

<table id="Table_01" width="775" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#FFFFFF">
<tr>
<td>
<table id="Table_01" width="775" height="32" align="center" border="0" cellpadding="0" cellspacing="0">

	<tr>

		<td width="233" height="32"><img src="images/banner.jpg" width="774" height="100" alt=""></td>

		
	</tr>
</table>  </td></tr>
  <tr>
    <td ><table id="Table_02" width="775" height="24" align="center" bgcolor="#000000" border="0" cellpadding="0" cellspacing="0">

	<tr>

		<td width="544" align="left" valign="middle">

		&nbsp;&nbsp;&nbsp;<a href="index.php" class="ummenu">Home</a>


		&nbsp;&nbsp;&nbsp;&nbsp;
		
		<a href="customer_service.php" class="ummenu">Customer Services</a>
		
		&nbsp;&nbsp;&nbsp;&nbsp;

		<a href="contact_us.php" class="ummenu">Contact Us</a>
		
		&nbsp;&nbsp;&nbsp;&nbsp;

		<a href="aboutus.php" class="ummenu">About Us</a>

		

		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>

		<td width="231" height="24" align="right" valign="middle"><a href="http://66.94.233.46/babelfish/trurl_pagecontent?lp=en_ja&trurl=http%3a%2f%2fwww.umgroups.com">

		</a>&nbsp;&nbsp;

		<a href="http://66.94.233.46/babelfish/trurl_pagecontent?lp=en_zt&trurl=http%3a%2f%2fwww.umgroups.com">		</a>&nbsp;&nbsp;

		<a href="http://66.94.233.46/babelfish/trurl_pagecontent?lp=en_ko&trurl=http%3a%2f%2fwww.umgroups.com">		</a>&nbsp;&nbsp;&nbsp;&nbsp;</td>

	</tr>

</table></td></tr>
<!-- Search --><table width="775" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC" align="center">
<tr>
	<td><table width="700" border="0" cellpadding="0" cellspacing="0" align="center">
		 <tr>
		   <td></td>
		   <td align="right">&nbsp;</td>
	      </tr>
		 <tr>
		   <td></td>
		   <td align="right">&nbsp;</td>
	      </tr>
		 <tr>
		   <td></td>
		   <td align="right">&nbsp;</td>
	      </tr>
		 <tr>
          <td>		  </td>
          <td align="right"><a href="<?= $_SERVER['PHP_SELF'] ?>?logout">Logout</a></td>
		  <?= (isset($errname)) ? "<td><font color='red'><strong>".$errname."</strong></font></td>" : "" ?>
        </tr>
		<tr>
          <td valign="top" colspan="2">		</td>
         </tr>
		
		 <tr><td colspan="2" height="10px"></td></tr>
		 <tr>
          <td valign="top"></td>
          <td></td>
        </tr>
      	<tr>
          <td valign="top"></td>
          <td></td>
      	</tr><tr>
          <td valign="top"></td>
          <td><input type="hidden" name="brand_id" value="<?= $brand_id ?>"></input></td>
        </tr>
		<tr>
          <td valign="top">Brand</td>
          <td><input type="text" name="brand"></input></td>
        </tr>
		<tr>
          <td valign="top">Type</td>
          <td><input type="text" name="type"></input></td>
        </tr>
		<tr>
          <td valign="top">Price</td>
          <td><input type="text" name="price"></input></td>
        </tr>
		
  		<tr>
    	  <td>Choose your Image to Upload</td>    
    	  <td><input name="myfile" type="file" size="50"></td>
  		</tr>
  		<tr><td colspan="2" height="10px"></td></tr>
		<tr><td></td>
		<td><input type="submit" value="Insert" name = "Insert" ></td>
		</tr>
		<tr>
		  <td></td>
		  <td>&nbsp;</td>
		  </tr>
		<tr>
		  <td></td>
		  <td>&nbsp;</td>
		  </tr>
		<tr>
		  <td></td>
		  <td>&nbsp;</td>
		  </tr>
		<tr>
		  <td></td>
		  <td>&nbsp;</td>
		  </tr>
		
		
		</table>
		<table align="center" border="0" cellpadding="0" cellspacing="0" width="775" id="table6" bgcolor="#FFFFFF" style="border-bottom: 3px solid #DF8A0B;">


			<tr>

				<td width="100%" height="2" bgcolor="#CCCCCC" class="foot"></td>
			</tr>

			<tr>

				<td height="30" class="foot">&nbsp;</td>
			</tr>
		</table>
	</td>
</tr>

</table>
</form><br><br><br><br>

</body>
</html>